package id.mankel.commons.util;

import java.util.function.BiConsumer;
import java.util.function.Function;

public class MkBeans {

    public static <T, R> R safeGet(Function<T, R> getter, T t) {
        if (null == t) return null;
        return getter.apply(t);
    }

    public static <T, V> void safeSet(BiConsumer<T, V> setter, T t, V v) {
        if (null == t) return;
        setter.accept(t, v);
    }

}
